package com.lz.service.ly.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lz.entity.AuditLogging;
import com.lz.entity.EquipmentSheet;
import com.lz.entity.InstallationPerson;
import com.lz.entity.UpholsteryType;
import com.lz.repository.ly.EquipmentSheetByStateRepository;
import com.lz.repository.xjl.InstallationPersonDao;
import com.lz.service.ly.EquipmentSheetByStateService;
import com.lz.vo.ly.EquipmentSheetConditionVO;

@Service
public class EquipmentSheetByStateServiceImpl implements EquipmentSheetByStateService {

	@Autowired
	private EquipmentSheetByStateRepository stateRepository ;
	@Autowired
	private InstallationPersonDao installationPersonDao;
	
	@Override
	public List<EquipmentSheetConditionVO> getEquipmentSheetByState(Integer pageNo,Integer pageSize,EquipmentSheet sheet,String start_time,String end_time) {
		return stateRepository.getEquipmentSheetByState(pageNo,pageSize,sheet,start_time,end_time);
	}

	@Override
	public Integer getEsByState(EquipmentSheet sheet,String start_time,String end_time) {
		return stateRepository.getEsByState(sheet,start_time,end_time);
	}

	@Override
	public boolean updEquipmentSheetState(String result,Integer equipmentSheetNo) {
		Integer i = stateRepository.updEquipmentSheetState(result,equipmentSheetNo);
		if(i > 0) {
			return true;
		}
		return false;
	}

	@Override
	public List<UpholsteryType> getType() {
		return stateRepository.getType();
	}

	@Override
	public void savaAuditLogging(AuditLogging logging) {
		stateRepository.savaAuditLogging(logging);
	}

	@Override
	public EquipmentSheet getEquipmentSheetById(Integer id) {
		return stateRepository.getEquipmentSheetById(id);
	}

	@Override
	public List<InstallationPerson> getInstallationPersonList() {
		
		return installationPersonDao.getInstallationPersonList();
	}

	@Override
	public InstallationPerson getPersonId(Integer id) {
		
		return installationPersonDao.getPersonId(id);
	}

	@Override
	public void addPerson(Integer id, Integer personNo) {
		stateRepository.addPerson(id, personNo);
	}

}
